<template>
	<view class="collectmain">
		<view class="Localcontent">
			<view v-for="item in collectList" :key="item.id" class="container" @click="go(item.id)">
				<image class="shopimg" :src="item.logo" style="width: 200rpx;height: 200rpx;" mode=""></image>
				<view class="word">
					<text class="name">{{item.merchantName}}</text>
					<view class="Sstar">
						<view class="star">
							<image src="https://obs-4a40.obs.cn-southwest-2.myhuaweicloud.com/shop/star.png" mode=""></image>
							<image src="https://obs-4a40.obs.cn-southwest-2.myhuaweicloud.com/shop/half.png" mode=""></image>
							<image src="https://obs-4a40.obs.cn-southwest-2.myhuaweicloud.com/shop/grey.png" mode=""></image>
							<image src="https://obs-4a40.obs.cn-southwest-2.myhuaweicloud.com/shop/grey.png" mode=""></image>
							<image src="https://obs-4a40.obs.cn-southwest-2.myhuaweicloud.com/shop/grey.png" mode=""></image>
						</view>
						<view class="about">
							<text style="color: #FFB31A;font-size: 24rpx;margin-left: -18rpx;">{{item.avgScore}} 分</text>
						</view>
						<view>
							<text style="color: #111111;font-size: 24rpx;margin-left: 20rpx;">{{item.count}} 评价</text>
						</view>
					</view>
					<view class="wordtype">
						<view class="type">
							<text>种类多</text>
						</view>
						<view class="type">
							<text>干净</text>
						</view>
					</view>
					<view class="worddistance">
						<text style="color: #1A1A1A;font-size: 24rpx;">
							{{item.distance}}m</text> </view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				collectList: []
			}
		},

		onLoad() {
			// 收藏界面
			const requestCollectshop = {
				url: `/api/collect/selectAccount/list`,
				method: "post",
				data: {
					vid: 1,
					longitude: 104.07436900000000000000,
					latitude: 30.55898000000000000000,
					current: 1,
					size: 10,
				},
				callBack: (res) => {
					this.text = 'request success';
					console.log(this.collectList)
					this.collectList = res.data.records
				}
			}
			this.$http.request(requestCollectshop)
		},

		methods: {
			go(e) {
				uni.navigateTo({
					url: '../allbuy/Hot?sid=' + e
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #F1F1F1;
	}

	.container {
		width: 100%;
		height: 200rpx;
		background-color: #FFFFFF;
		border-bottom: 4rpx solid #F1F1F1;
		display: flex;
		padding: 27rpx 20rpx;
	}

	.container .shopimg {
		margin-right: 20rpx;
	}

	.word {
		position: relative;
	}

	.word .name {
		color: #111111;
		display: block;
		font-size: 32rpx;
		font-weight: bold;
		margin-bottom: 12rpx;
	}

	.Sstar {
		display: flex;
		flex-direction: row;
	}

	.Sstar .star {
		margin-right: 40rpx;
	}

	.star image {
		width: 40rpx;
		height: 40rpx;
	}

	.Sstar .about {
		margin-right: 30rpx;
	}

	.wordtype {
		flex-direction: row;
		display: flex;
		position: absolute;
		top: 160rpx;
	}

	.type {
		background-color: #FFEEE6;
		width: 112rpx;
		height: 40rpx;
		border-radius: 24px;
		color: #FF6633;
		font-size: 24rpx;
		line-height: 40rpx;
		margin-right: 10rpx;
		text-align: center;
	}

	.worddistance {
		position: absolute;
		top: 160rpx;
		right: -80rpx;
	}
</style>
